home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / fw_teTeX.idb / usr / freeware / bin / dvi2fax.z / dvi2fax
Text File  |  2001-01-10  |  1KB  |  38 lines

  1. #!/bin/sh
  2. # options for dvips are passwd down
  3.  
  4. test -f /bin/sh5 && test -z "$RUNNING_SH5" \
  5.   && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
  6.   && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; }
  7. unset RUNNING_SH5
  8.  
  9. test -f /bin/bsh && test -z "$RUNNING_BSH" \
  10.   && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \
  11.   && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
  12. unset RUNNING_BSH
  13.  
  14. progname=`basename $0`
  15. help()
  16. {
  17.   echo "Usage: $progname [-hi|-lo] file[.dvi] [options for dvips]"
  18.   echo "  -hi: use high fax resolution (204x196) (default)"
  19.   echo "  -lo: use low fax resolution (204x98)"
  20.   echo
  21.   echo "Example: $progname foo -l 2"
  22. }
  23.  
  24. dvipsconf=dfaxhigh; res=204x196
  25. case $1 in
  26.   -hi) dvipsconf=dfaxhigh; res=204x196; shift;;
  27.   -lo) dvipsconf=dfaxlo; res=204x98; shift;;
  28. esac
  29.  
  30. case $# in
  31. 0)    help >&2
  32.     exit 1 ;;
  33. esac
  34.  
  35. NAME=`basename $1 .dvi`
  36. dvips "$@" -P$dvipsconf -f |
  37.   gs -q -dSAFER -sDEVICE=faxg3 -r$res -sOutputFile=$NAME-%03d.fax -sNOPAUSE -
  38.